﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _01.NumbersFrom1ToN
{
    class printNumbersFrom1ToN
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Write a number");
            string number = Console.ReadLine();
            int num;
            if (int.TryParse(number, out num))
            {
                Console.WriteLine();
                Console.ForegroundColor = ConsoleColor.DarkRed;
                for (int i = 1; i <= num; i++)
                {
                    Console.WriteLine(i);
                }
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("Error!Insert a number!");
            }
        }
    }
}
